package com.demo.tomcat;

import java.io.IOException;
import java.io.OutputStream;
import java.nio.charset.StandardCharsets;

public class MyResponse {


    private OutputStream out;

    public MyResponse(OutputStream out) {
        this.out = out;
    }


    public void write(String s) throws IOException {
        String sb = "HTTP/1.1 200 OK\n" +
                "Content-Type: text/html;\n" +
                "\r\n" +
                s;
        out.write(sb.getBytes(StandardCharsets.UTF_8));
    }
}
